package xpn.business.fund_return.entity.rela_frcase;


import org.springframework.data.rest.webmvc.RepositoryRestController;
import org.springframework.web.bind.annotation.*;
import xpn.business.fund_return.entity.rela_frcase.dto.RelaFrCaseCreateDto;
import xpn.platform.common.repository.XpnRepositoryController;

import javax.annotation.Resource;
import java.util.List;

@RepositoryRestController
@RestController
@RequestMapping("relafrcase")
public class RelaFrCaseController extends XpnRepositoryController<RelaFrCase, Long> {

    @Resource
    private RelaFrCaseService relaFrCaseService;

    @PostMapping("/{caseId}")
    public List<RelaFrCase> saveRelaFrCase(@PathVariable Long caseId, @RequestBody RelaFrCaseCreateDto dto) {
        return relaFrCaseService.saveRelaFrCase(caseId, dto.getRelaFrCaseList());
    }
}
